var globalPermissions=[];
$(function(){
    new Vue({
        el:'.vue-menu',
        data:{
            menuList:[],
        },
        mounted:function(){
            var self = this;

            //显示列表
            self.$http.get('../privilege/authority2Show',{}).then(function(res){
                self.menuList = res.body.list;
            }/*,function(res){})
            //用户权限：与渲染数据无关，可先获取
            self.$http.get(basePath+'account/authority',{}).then(function(resopnse){
                var privilegeList = resopnse.body;
                for(var i=0 ; i< privilegeList.length; i++){
                    self.privilegeMap[privilegeList[i]]=true;
                }
            }*/,function(resopnse){
                console.log(resopnse.body)
            });
            //按钮权限
            self.$http.get('../privilege/buttonAuthority',{}).then(function(resopnse){
            	console.log(resopnse.body.btnPrivi.toString())
            	globalPermissions = resopnse.body.btnPrivi;
            },function(resopnse){
                console.log(resopnse.body)
            })
        },
        filters:{
        },
        methods:{
                slide: function (index,e) {
                var t=e.currentTarget;
                $('.menu_dropdown dl dd').not($('.menu_dropdown dl dd').eq(index)).slideUp('fast');
                $('.menu_dropdown dt').not($('.menu_dropdown dt').eq(index)).removeClass('selected');
                if($(t).siblings('dd').css('display')=="block"){
                	 $(t).removeClass('selected');
                }else{
                	 $(t).addClass('selected');
                }
                $(t).siblings('dd').slideToggle('fast');

            }
        }
    })
})
